package com.yuxi.Dao.Impl;

import java.io.Serializable;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import com.yuxi.Dao.PrisonRoleDao;
import com.yuxi.Entity.PrisonRole;
import com.yuxi.Entity.PrisonStructure;
import com.yuxi.Request.Page;

@Repository
public class PrisonRoleDaoImpl extends BaseDaoImpl<Serializable, Serializable> implements PrisonRoleDao {
	private Logger logger=LoggerFactory.getLogger(PrisonRoleDaoImpl.class);
	public PrisonRoleDaoImpl(){
		super(PrisonRole.class);
	}
	@Override
	public PrisonRole getPrisonRole(Integer prisonRoleId) {		
		return (PrisonRole) super.get(prisonRoleId);
	}

	@Override
	public PrisonRole addPrisonRole(PrisonRole pRole) {
		// TODO Auto-generated method stub
		return (PrisonRole) super.addAndReturn(pRole);
	}

	@Override
	public void deletePrisonRole(PrisonRole pRole) {
		// TODO Auto-generated method stub
		super.delete(pRole);
	}

	@Override
	public void modifly(PrisonRole pRole) {
		// TODO Auto-generated method stub
		super.update(pRole);
	}
	@Override
	public List<PrisonRole> getAllPrisonRole() {
		// TODO Auto-generated method stub
		return super.find("from PrisonRole");
	}
	@Override
	public List<PrisonRole> getRoleByStructureId(PrisonStructure pStructure) {
		return super.find("from  PrisonRole as p where p.prisonStructure=?", pStructure);
	}
	
	
	

}
